package main

import (
	"fmt"
)



func main()  {
	
	var arr [3]int
	fmt.Printf("arr的地址%p\n",&arr)
	fmt.Printf("第一个元素地址%p\n",&arr[0])
	fmt.Printf("第二个元素地址%p\n",&arr[1])

	var arr1 [3]int = [3]int {1,2,3}
	var arr2 = [3]int {4,5,6}
	var arr3 = [...]int {7,8,9}

	//可以指定元素值对应的下标
	var arr4 = [3]string {1:"tom",0:"marry",2:"jack"}

	fmt.Println(arr1)
	fmt.Println(arr2)
	fmt.Println(arr3)
	fmt.Println(arr4)

	test(&arr1)
	fmt.Println(arr1)
}

func test(arr *[3]int)  {
	(*arr)[1] = 10
}
